<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xsd:attributeGroup name="bookFlags">
    <xsd:attribute name="outofprint" type="xsd:boolean" />
    <xsd:attribute name="outofstock" type="xsd:boolean" />
  </xsd:attributeGroup>
  <xsd:group name="relateditems">
    <xsd:sequence>
      <xsd:element name="dvd" type="xsd:string"/>
      <xsd:element name="video" type="xsd:string"/>
    </xsd:sequence>
  </xsd:group>
  <xsd:annotation>
    <xsd:documentation>Books schema example</xsd:documentation>
    <xsd:documentation>This info will appear in documentation node</xsd:documentation>
    <xsd:appinfo>Books application info</xsd:appinfo>
  </xsd:annotation>
  <xsd:notation name="bookapp" public="books.xsd" system="bookapp.exe" />
  <xsd:element name="bookstore" type="bookstoreType" />
  <xsd:complexType name="bookstoreType">
    <xsd:sequence maxOccurs="unbounded">
      <xsd:element name="book" type="bookType" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="bookType">
    <xsd:sequence>
      <xsd:element name="title" type="xsd:string" />
      <xsd:element name="author" type="authorName" />
      <xsd:element name="price" type="xsd:decimal" />
      <xsd:group ref="relateditems" />
    </xsd:sequence>
    <xsd:attribute name="genre" type="xsd:string" />
    <xsd:attributeGroup ref="bookFlags" />
  </xsd:complexType>
  <xsd:complexType name="authorName">
    <xsd:sequence>
      <xsd:element name="first-name" type="xsd:string" />
      <xsd:element name="last-name" type="xsd:string" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
